package com.kexio.config.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kexio.common.entity.BaseEntity;

/**
 * 系统配置实体
 * 
 * @author Kexio Team
 * @since 1.0.0
 */
@TableName("sys_config")
public class SystemConfig extends BaseEntity {
    
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;
    
    /**
     * 配置键名
     */
    @TableField("config_key")
    private String configKey;
    
    /**
     * 配置值
     */
    @TableField("config_value")
    private String configValue;
    
    /**
     * 配置名称
     */
    @TableField("config_name")
    private String configName;
    
    /**
     * 配置类型
     */
    @TableField("config_type")
    private String configType;
    
    /**
     * 配置分组
     */
    @TableField("config_group")
    private String configGroup;
    
    /**
     * 配置描述
     */
    @TableField("description")
    private String description;
    
    /**
     * 配置状态
     */
    @TableField("status")
    private String status;
    
    /**
     * 是否系统内置 (内置配置不允许删除)
     */
    @TableField("is_builtin")
    private Boolean isBuiltin;
    
    /**
     * 是否敏感配置 (密码等敏感信息)
     */
    @TableField("is_sensitive")
    private Boolean isSensitive;
    
    /**
     * 是否可修改
     */
    @TableField("is_editable")
    private Boolean isEditable;
    
    /**
     * 数据类型 (string, integer, boolean, json等)
     */
    @TableField("data_type")
    private String dataType;
    
    /**
     * 默认值
     */
    @TableField("default_value")
    private String defaultValue;
    
    /**
     * 值范围或格式说明
     */
    @TableField("value_range")
    private String valueRange;
    
    /**
     * 排序号
     */
    @TableField("sort_order")
    private Integer sortOrder;
    
    /**
     * 环境标识 (dev, test, prod, all)
     */
    @TableField("environment")
    private String environment;
    
    /**
     * 版本号
     */
    @TableField("version")
    private Integer version;
    
    /**
     * 最后修改人
     */
    @TableField("last_modifier")
    private String lastModifier;
    
    // Constructors
    public SystemConfig() {}
    
    public SystemConfig(String configKey, String configValue, String configName, String configType) {
        this.configKey = configKey;
        this.configValue = configValue;
        this.configName = configName;
        this.configType = configType;
        this.status = "ENABLED";
        this.isBuiltin = false;
        this.isSensitive = false;
        this.isEditable = true;
        this.dataType = "string";
        this.sortOrder = 0;
        this.environment = "all";
        this.version = 1;
    }
    
    // Getters and Setters
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    
    public String getConfigKey() { return configKey; }
    public void setConfigKey(String configKey) { this.configKey = configKey; }
    
    public String getConfigValue() { return configValue; }
    public void setConfigValue(String configValue) { this.configValue = configValue; }
    
    public String getConfigName() { return configName; }
    public void setConfigName(String configName) { this.configName = configName; }
    
    public String getConfigType() { return configType; }
    public void setConfigType(String configType) { this.configType = configType; }
    
    public String getConfigGroup() { return configGroup; }
    public void setConfigGroup(String configGroup) { this.configGroup = configGroup; }
    
    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }
    
    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }
    
    public Boolean getIsBuiltin() { return isBuiltin; }
    public void setIsBuiltin(Boolean isBuiltin) { this.isBuiltin = isBuiltin; }
    
    public Boolean getIsSensitive() { return isSensitive; }
    public void setIsSensitive(Boolean isSensitive) { this.isSensitive = isSensitive; }
    
    public Boolean getIsEditable() { return isEditable; }
    public void setIsEditable(Boolean isEditable) { this.isEditable = isEditable; }
    
    public String getDataType() { return dataType; }
    public void setDataType(String dataType) { this.dataType = dataType; }
    
    public String getDefaultValue() { return defaultValue; }
    public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; }
    
    public String getValueRange() { return valueRange; }
    public void setValueRange(String valueRange) { this.valueRange = valueRange; }
    
    public Integer getSortOrder() { return sortOrder; }
    public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; }
    
    public String getEnvironment() { return environment; }
    public void setEnvironment(String environment) { this.environment = environment; }
    
    public Integer getVersion() { return version; }
    public void setVersion(Integer version) { this.version = version; }
    
    public String getLastModifier() { return lastModifier; }
    public void setLastModifier(String lastModifier) { this.lastModifier = lastModifier; }
}
